package Jets.shapes
{
	import flash.display.Sprite;
	
	public class JCircle extends Sprite
	{
		private var ms_radis:Number;
		private var ms_color:int;
		private var ms_line:Number;
		private var ms_lineColor:int;
		
		/**
		 *  画园
		 * @param radis 半径
		 * @param color 填充颜色
		 * @param line 线的宽度
		 * @param lineColor 线的颜色
		 */
		public function JCircle(radis:Number,color:uint,line:Number,lineColor:int)
		{
			super();
			ms_radis = radis;
			ms_color = color;
			ms_line = line;
			ms_lineColor = lineColor;
			
			this.drawCircle();
		}
		
		protected function drawCircle():void
		{
			this.graphics.clear();
			if(ms_line)
			{
				this.graphics.lineStyle(ms_line,ms_lineColor);
			}
			this.graphics.beginFill(ms_color,1);
			this.graphics.drawCircle(ms_radis,ms_radis,ms_radis);
			this.graphics.endFill();
		}
		public function setColor(color:uint):void
		{
			if(ms_color == color)
			{
				return;
			}
			ms_color = color;
			this.drawCircle();
		}
	}
}